﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/jqueryEasyui/js")
    @Styles.Render("~/jqueryEasyui/css")
    @Scripts.Render("~/Validform/js")
    @Styles.Render("~/Validform/css")
    <script src="/Scripts/jQuery.Extensions.js"></script>
    <title>Edit</title>
    <script type="text/javascript">
        $(function () {

            //初始化表单提交
            $(".registerform").Validform({
                tiptype: 2,
                postonce: true,
                ajaxPost: true,
                callback: function (data) {
                    if (data.status == "y") {

                    } else {
                    }
                }
            });

            $("#addRole").click(function () {
                window.parent.$("#drole").dialog({
                    title: '选择角色',
                    width: 550,
                    height: 430,
                    closed: false,
                    cache: false,
                    resizable:true,
                    content: '<iframe scrolling="no" frameborder="0" src="/adminweb/role/dialog" style="width:100%;height:98%;"></iframe>',
                    modal: true
                })
            })
            


            var editData = $.ifdata("editData");
            if (editData != null && editData != undefined) {
                $("#Account").val(editData.Account);
                $("#Account")
                    .attr("readonly", "true")
                    .css({ "border": "none", "background": "none" })
                    .removeAttr('ajaxurl');
                $("#Email").val(editData.Email);
                $("#UserName").val(editData.UserName);
                $("#IsDisabled").val(editData.IsDisabled.toString());
                $("#UserID").val(editData.UserID);
            }
        })

    </script>
</head>
<body>
    <form id="form1" @if (Model == "edit") { Write("action=/adminweb/user/editsave"); } else { Write("action=/adminweb/user/addSave"); } class="registerform">
        <div>

            <div style="margin: 10px; background-color: #F8F8F8; border: 1px solid #ccc; border-radius: 4px 4px 4px 4px; padding: 10px;">
                <div style="font-weight: bold; font-size: 14px;">
                    基本信息
                </div>
                <table width="540">
                    <tr>
                        <td style="width: 60px;">
                            <span style="color: Red">*&nbsp;</span>用户名：
                        </td>
                        <td style="width: 130px;">
                                <input type="text" id="Account" name="Account" class="inputxt" ajaxurl="/user/verifyName"
                                    datatype="*1-40" nullmsg="填写用户名，用户于系统登录账户。" errormsg="长度为1~40，请输入正确的字符串长度" />
                        </td>
                        <td>
                            <div class="Validform_checktip">
                                填写用户名，用户于系统登录账户。
                            </div>
                        </td>
                    </tr>
                    @*<tr>
                    <td>
                        <span style="color: Red">*&nbsp;</span>密&nbsp;&nbsp;&nbsp;码：
                    </td>
                    <td>
                        <input type="password" id="Password" name="Password" class="inputxt" datatype="*6-20"
                            nullmsg="请填写登录密码。" errormsg="长度为6~20，请输入正确的字符串长度" />
                    </td>
                    <td>
                        <div class="Validform_checktip">
                            请填写登录密码。
                        </div>
                    </td>
                </tr>*@
                    <tr>
                        <td>
                            <span style="color: Red">*&nbsp;</span>邮&nbsp;&nbsp;&nbsp;箱：
                        </td>
                        <td>
                            <input type="text" id="Email" name="Email" class="inputxt" datatype="e" nullmsg="请填写邮箱。"
                                errormsg="请输入合法邮箱，长度不可超过50个字符。" />
                        </td>
                        <td>
                            <div class="Validform_checktip">
                                请填写邮箱。
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span style="color: Red">*&nbsp;</span>姓&nbsp;&nbsp;&nbsp;名：
                        </td>
                        <td>
                            <input type="text" id="UserName" name="UserName" class="inputxt" datatype="*1-20"
                                nullmsg="请填写真实姓名。" errormsg="长度为1~20，请输入正确的字符串长度" />
                        </td>
                        <td>
                            <div class="Validform_checktip">
                                请填写真实姓名。
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span style="color: Red">*&nbsp;</span>状&nbsp;&nbsp;&nbsp;态：
                        </td>
                        <td>
                            <select id="IsDisabled" name="IsDisabled">
                                <option value="true">开启</option>
                                <option value="false">禁用</option>
                            </select>
                        </td>
                        <td></td>
                    </tr>
                </table>
            </div>
            <div style="margin: 10px; background-color: #F8F8F8; border: 1px solid #ccc; border-radius: 4px 4px 4px 4px; padding: 10px;">
                <div style="font-weight: bold; font-size: 14px;">
                    所属角色
                </div>
                <div id="roles_list">
                    @*<span id="<%#Eval("RoleID")%>">
                        <%#Eval("RoleName")%>&nbsp;<img src="/admin/images/11.gif" alt="删除角色" /></span>*@
                </div>
            </div>
            <div style="padding: 5px; text-align: right">
                <a href="#" id="addRole" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-add'">添加所属角色</a>
                <a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-save'" onclick="$('form').submit()">保 存</a>
                <a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-cancel'">取 消</a>
                <input type="hidden" id="UserID" name="UserID" value="" />
            </div>
        </div>
    </form>
</body>
</html>
